﻿//
// Created by francklinson on 2021/3/28.
//

#ifndef CPPPRIMERPLUSREADINGCODES_PORT_H
#define CPPPRIMERPLUSREADINGCODES_PORT_H


#include <iostream>
#include <cstring>

using namespace std;

class Port
{
private:
    char *brand;
    char *style; // i.e., tawny, ruby, vintage
    int bottles;
public:
    explicit Port(const char *br = "none", const char *st = "none", int b = 0);

    Port(const Port &p); // copy constructor
    virtual ~Port()
    { delete[] brand; }

    Port &operator=(const Port &p);

    Port &operator+=(int b); // adds b to bottles
    Port &operator-=(int b); // subtracts b from bottles, if available
    int BottleCount() const
    { return bottles; }

    virtual void Show() const;

    friend ostream &operator<<(ostream &os, const Port &p);
};

#endif //CPPPRIMERPLUSREADINGCODES_PORT_H
